package com.liujun.spring4.demo.aop.iocset.xmlset.collection;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 * 进行工厂方法测试
 * @author liujun
 * @version 1.0
 * @date 2018-08-16 17:33:00
 */
public class BeanCollectionMarge {

    private ApplicationContext context;

    @BeforeClass
    private void start() {
        context =
                new ClassPathXmlApplicationContext(
                        "com/liujun/spring4/demo/aop/iocset/xmlset/collection/beanCollectionMarge.xml");
    }

    @Test
    public void getListMarge() {
        BeanList list = (BeanList) context.getBean("listChild");

        Assert.assertNotNull(list);
    }

    @Test
    public void getSetMarge()
    {
        BeanSet set = (BeanSet) context.getBean("childSet");
        Assert.assertNotNull(set);
    }

    @Test
    public void getMapMarge()
    {
        BeanMap map = (BeanMap) context.getBean("childMap");
        Assert.assertNotNull(map);
    }

    @Test
    public void getPropsMarge()
    {
        BeanProperties props = (BeanProperties)context.getBean("childProp");
        Assert.assertNotNull(props);
    }

    @Test
    public void getMapGenMarge()
    {
       BeanMapGen beanmMapGen =  (BeanMapGen)context.getBean("chlildMapGen");
       Assert.assertNotNull(beanmMapGen);
    }
}
